<%@page import="java.util.List"%>
<%@page import="utilities.Entiteta"%>
<%@page import="utilities.Novica"%>
<%@page import="utilities.Uporabnik"%>
<%	
List<Entiteta> list = (List)request.getAttribute("novice");
Uporabnik up = (Uporabnik)session.getAttribute("uporabnik");

// for-zanka za izpis novic
	for (Entiteta ent : list) {
		 Novica n = (Novica)ent;
%>
		<tr>
			<td>
				<h4><% out.println(n.getNaziv());  %></h4>
				<p><% out.println(n.getVsebina());  %></p>
				<p><i>Objavil <strong><% if (n.getIdA() == 1) { out.println("Janez Novak"); } else { out.println("neznanec"); }  %></strong>, <% out.println(n.getDatum());  %></i></p>
				<% 
				if (up.getTip() == "admin") {
					%>
						<p><a href="urediNovico.jsp?id=<% out.println(n.getId()); %>">uredi</a> | <a href="includes/odstraniNovico.jsp?id=<% out.println(n.getId()); %>">odstrani</a></p>
						<hr />
					<%
				}
				%>
			</td>
		</tr>
		<%
	}
%>